<template>
  <el-input
    v-model="value"
    v-bind="$attrs"
    :name="colName"
    :maxlength="maxLength"
  ></el-input>{{$attrs}}
</template>

<script>
  import { ref, computed, onMounted } from 'vue'
  import { ElInput } from 'element-plus'
</script>

<script setup>

  const props = defineProps({
    modelValue: [String, Number, Object],
    colName: String,
    maxLength: Number
  })

  const emit = defineEmits(['update:modelValue'])

  // v-model 的中转
  const value = computed({
    set: (val) => {
      emit('update:modelValue', val)
    },
    get: () => {
      return props.modelValue
    }
  })

</script>